/**
 * Created by WangMing on 15/12/9.
 */
define(["../../../service",
  "../../../widgets/player_widget/player_widget",
  "../../../widgets/scrollbox_widget/scrollbox_widget",
  "../../../assets/vendor/jquery-scrollbox/jquery.scrollbox"], function (api) {
  // 定义所有相关的vmodel
  var vm = avalon.define({
      $id: "weikePlay",
      $player: {},
      $breadcrumb: {
          stateName:"weikes.item.play"
      },
      $skipArry : ["playerWidget"]
    });


  return avalon.controller(function ($ctrl) {
    // 视图渲染后，意思是avalon.scan完成
    $ctrl.$onRendered = function () {
     


     
    };
    // 进入视图
    $ctrl.$onEnter = function (param, rs, rj) {

      api.getItems({
            method: api.getVideo,
            query:{
                guid: param.vid,
                order: null
            }
      }

      ,function(res){
        vm.$player = _.merge(vm.$player,res[0]);
      })



      
    };
    // 对应的视图销毁前
    $ctrl.$onBeforeUnload = function () {

    };
    $ctrl.$vmodels = [vm];
  })
});